<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'manager_root.jsp' starting page</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/vendor/linearicons/style.css">
<!-- MAIN CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/main.css">
<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/demo.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/dist/css/bootstrapValidator.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/datetimepicker/css/bootstrap-datetimepicker.min.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/vendor/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/dist/js/bootstrapValidator.js"></script>
<script src="${pageContext.request.contextPath }/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/datetimepicker/js/locales/bootstrap-datetimepicker.fr.js"></script>
</head>

<body>
	<c:set var="roottype" value="root"></c:set>
	<c:set var="editortype" value="editor"></c:set>
	<div id="wrapper">
		<jsp:include page="top.jsp"></jsp:include>
		<c:choose>
			<c:when test="${sessionScope.Manager.utype == pageScope.roottype}">
				<jsp:include page="leftroot.jsp"></jsp:include>
			</c:when>
			<c:when test="${sessionScope.Manager.utype == pageScope.editortype}">
				<jsp:include page="lefteditor.jsp"></jsp:include>
			</c:when>
		</c:choose>
		<div class="main">
			<div class="container">
				<div class="row">
					<!-- form: -->
					<section>
						<div class="page-header text-center">
						<h1>用户修改</h1>
					</div>
					<div class="col-lg-8 col-lg-offset-2">
						<form id="defaultForm" method="post" action="${pageContext.request.contextPath }/manage/UpdateUserServlet.do?
						uid=${requestScope.user.uid}&querytype=${requestScope.querytype}&field=${requestScope.field}&kw=${requestScope.kw}&currPage=${requestScope.currPage}"
							class="form-horizontal">
								<div class="form-group">
									<label class="col-lg-3 control-label">密码：</label>
									<div class="col-lg-5">
										<input type="password" value="" class="form-control" name="password"
										 />
									</div>
								</div>

								<div class="form-group">
									<label class="col-lg-3 control-label">重复密码：</label>
									<div class="col-lg-5">
										<input type="password" value="" class="form-control"
											name="confirmPassword" />
									</div>
								</div>




								<div class="form-group">
									<label class="col-lg-3 control-label">姓名：</label>
									<div class="col-lg-5">
										<input type="text" value="${requestScope.user.utname }" class="form-control" name="name"
											 />
									</div>
								</div>

								<div class="form-group">
									<label class="col-lg-3 control-label">邮箱地址：</label>
									<div class="col-lg-5">
										<input type="text" value="${requestScope.user.uemail }" class="form-control" name="email"
											 />
									</div>
								</div>



								<div class="form-group">
									<label class="col-lg-3 control-label">电话：</label>
									<div class="col-lg-5">
										<input type="text" value="${requestScope.user.uphone }" class="form-control" name="phoneNumber"
											 />
									</div>
								</div>

								<div class="form-group">
									<label class="col-lg-3 control-label">出生日期：</label>
									<div class="controls input-append date form_date col-lg-5"
										data-date="" data-date-format="yyyy-mm-dd"
										data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
										<input class="form-control" type="text" value="${requestScope.user.ubirthday }" readonly>
										<span class="add-on"><i class="icon-remove"></i></span> <span
											class="add-on"><i class="icon-th"></i></span>
									</div>
									<input type="hidden" id="dtp_input2" value="" name="birthday"/><br />
								</div>

								<div class="form-group">
									<div class="col-lg-2 col-lg-offset-4">
										<button type="submit" class="btn btn-primary btn-sm btn-block">修改</button>
									</div>
								</div>
						</form>
					</div>
					</section>
					<!-- :form -->
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('.form_datetime').datetimepicker({
			//language:  'fr',
			weekStart : 1,
			todayBtn : 1,
			autoclose : 1,
			todayHighlight : 1,
			startView : 2,
			forceParse : 0,
			showMeridian : 1
		});
		$('.form_date').datetimepicker({
			language : 'fr',
			weekStart : 1,
			todayBtn : 1,
			autoclose : 1,
			todayHighlight : 1,
			startView : 2,
			minView : 2,
			forceParse : 0
		});
		$('.form_time').datetimepicker({
			language : 'fr',
			weekStart : 1,
			todayBtn : 1,
			autoclose : 1,
			todayHighlight : 1,
			startView : 1,
			minView : 0,
			maxView : 1,
			forceParse : 0
		});
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#defaultForm').bootstrapValidator({
				message : 'This value is not valid',
				feedbackIcons : {
					valid : 'glyphicon glyphicon-ok',
					invalid : 'glyphicon glyphicon-remove',
					validating : 'glyphicon glyphicon-refresh'
				},
				fields : {
					username : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							stringLength : {
								message : '用户名必须为3-11位',
								min : 3,
								max : 11,

							},
							remote : {
								url : "ordinary/OrdinaryRegisterAjaxServlet.do",//UserAjaxSer
								type : "Post",
								message : "用户名已存在",

								data : {
									username : function() {
										return $("#userName").val();
									},

								}
							}

						}
					},

					acceptTerms : {
						validators : {
							notEmpty : {
								message : '接受项目条款后方可注册'
							}
						}
					},
					name : {
						validators : {
							notEmpty : {
								message : '不能为空'
							}
						}
					},
					email : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							emailAddress : {
								message : '请输入正确的邮箱地址'
							}
						}
					},
					phoneNumber : {
						validators : {
							stringLength : {
								min : 11,
								max : 11,
								message : '请输入合法的电话号码'
							},
						}
					},

					password : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							identical : {
								field : 'confirmPassword',
								message : '两次密码输入不一致'
							}
						}
					},
					confirmPassword : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							identical : {
								field : 'password',
								message : '两次密码输入不一致'
							}
						}
					},
				}
			});
		});
	</script>
</body>
</html>
